import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 上课场地信息信息 */
export interface ClassLocation {
          locationId: number; // 场地唯一ID
          locationName?: string; // 场地名称，如笃志楼机房9
          locationType: string; // 场地类型，如机房、实训室
  }

// 上课场地信息 API
export const ClassLocationApi = {
  // 查询上课场地信息分页
  getClassLocationPage: async (params: any) => {
    return await request.get({ url: `/ao/class-location/page`, params })
  },

  // 查询上课场地信息详情
  getClassLocation: async (id: number) => {
    return await request.get({ url: `/ao/class-location/get?id=` + id })
  },

  // 新增上课场地信息
  createClassLocation: async (data: ClassLocation) => {
    return await request.post({ url: `/ao/class-location/create`, data })
  },

  // 修改上课场地信息
  updateClassLocation: async (data: ClassLocation) => {
    return await request.put({ url: `/ao/class-location/update`, data })
  },

  // 删除上课场地信息
  deleteClassLocation: async (id: number) => {
    return await request.delete({ url: `/ao/class-location/delete?id=` + id })
  },

  /** 批量删除上课场地信息 */
  deleteClassLocationList: async (ids: number[]) => {
    return await request.delete({ url: `/ao/class-location/delete-list?ids=${ids.join(',')}` })
  },

  // 导出上课场地信息 Excel
  exportClassLocation: async (params) => {
    return await request.download({ url: `/ao/class-location/export-excel`, params })
  },
}